RtndConfigure

RtndConfigure is called for each instance of the driver when the driver should configure the NIC hardware. This function should set up receive buffers/transmit buffers, card modes, events, etc.

NOTE: The driver should NOT enable interrupts or packet reception on the NIC within RtndConfigure. The driver should wait until the RtndUpDown routine is called before enabling interrupts or packet reception.

Syntax

int RtndConfigure (
    void *ndp
);

Parameters

ndp

Network Device Pointer. Opaque network device identifier.

Return Value

A return value of 0 indicates Success, -1 indicates Failure.

Remarks

The RtndConfigure function may be called more than once for a given driver. The RtndConfigure function will be called for every device the driver needs to service. The driver can use the RtnGetDeviceName function to retrieve the ASCII device name used for a given instance of the driver.  It can then match this device name with those stored in the local configuration array to find its local configuration data. The driver should then store the appropriate index to its local configuration array in the network device data structure pointer, parameter ndp, by using RtnSetDataLong. This will allow the driver to quickly locate its local configuration data in all other RTND functions by using RtnGetDataLong, instead of matching the device name.

The RtndConfigure routine must use the RtnSetLinkAddress function to notify the stack of the Ethernet address for the NIC associated with this instance of the driver. RtndConfigure should also create any events it will need, along with creating and starting a Receive and possibly Transmit thread.  

A Transmit thread is needed in cases where a driver requires that a packet be completed before the next packet is handed to the RtndTransmit routine.  In this case of packet completion, a Transmit thread waits to be notified by an event from the Interrupt Service thread that the packet is complete and then calls RtnTransmitDone. The Transmit thread is required since RtnTransmitDone will very likely invoke a Critical section deadlock if called from the Interrupt Service thread itself.

If the driver can handle queuing multiple packets within the driver transmit buffers, then the driver may safely call RtnTransmitDone in the RtndTransmit routine and there is no need to have a Transmit thread. In this case, the driver must copy the data from the packet passed to RtndTransmit into its local transmit buffer queue before calling RtnTransmitDone.  RtnTransmitDone frees the most recent packet handed to RtndTransmit, so the data must either be sent or copied before calling RtnTransmitDone.

Process Context

RtndConfigure is always called from within the process context of the RtxTcpIp Protocol Stack.

Requirements

Minimum Supported Version RTX64 2013
Header RtnApi.h
Library RtTcpip.lib